package com.hpe.springboot.springbootmybatis.dao;


import com.hpe.springboot.springbootmybatis.entity.Student;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface StudentDao {
    /**
     * 插入一条数据
     * @param student
     */
    @Insert("insert into student(name,sex,address) value (#{name},#{sex},#{address})")
    void Student(Student student);

    /**
     * 查询所有数据
     * @return
     */
    @Select("select * from student")
    List<Student> findAll();

    /**
     * 根据id查询一条数据
     */
    @Select("select * from student where id = #{id}")
    Student findById(Integer id);
}
